home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Broadcaster / Receiver.h < prev   
Encoding:
Text File  |  1997-06-28  |  493 b   |  28 lines  |  [TEXT/CWIE]

  1. // Receiver.h
  2.  
  3. #ifndef Receiver_h
  4. #define Receiver_h
  5.  
  6. #ifndef BroadcastLink_h
  7. #include "BroadcastLink.h"
  8. #endif
  9.  
  10. template < class Protocol >
  11. class Receiver: public Protocol
  12.   {
  13.     typedef Broadcaster< Protocol > Source;
  14.     
  15.     private:
  16.         BroadcastLink< Protocol > link;
  17.     
  18.     public:
  19.         Receiver( const Source& source, bool startEnabled = true )
  20.           : link( source, *this, startEnabled )
  21.           {}
  22.         
  23.         Enableable& Link()                    { return link; }
  24.         const Enableable& Link() const    { return link; }
  25.   };
  26.  
  27. #endif
  28.